package com.guomao.generics;

import java.util.List;

public class MyGenericD<E> {


    public <E> void each(E[] arr) {

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }


    //无界通配符
    public void each(List<?> list) {

        /*for (int i = 0; i < list.size(); i++) {
            Object o = list.get(i);
        }*/

        for (Object o : list) {
            System.out.println(o);
        }
    }

}
